package org.openqa.selenium.profiler.testserver;

import static org.junit.Assert.*;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class AppServerTest {
  @Test
  public void testGetsPageOnce() {
    String url = AppServer.serveHtmlOnce("<html><body>foo</body></html>");
    WebDriver driver = new FirefoxDriver();

    driver.get(url);
    assertEquals("foo", driver.findElement(By.tagName("body")).getText());

    driver.get(url);
    assertFalse(driver.findElement(By.tagName("body")).getText().contains("foo"));
  }
}
